<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
  <caption>用户列表</caption>
  <tr>
    <th>用户名</th>
    <th>密码</th>
    <th>昵称</th>
  </tr>
</table>
<script>
  let arr =[{username:"韩非",password:1233,nickname:"流沙"},
      {username:"紫女",password:1233,nickname:"流沙"},
      {username:"卫庄",password:1233,nickname:"流沙"}
  ]
  let table = document.querySelector("table")
  for (let user of arr) {
    let tr = document.createElement("tr")
    let usernameId = document.createElement("td")
    let passwordId = document.createElement("td")
    let nicknameId = document.createElement("td")
    usernameId.innerText = user.username
    passwordId.innerText = user.password
    nicknameId.innerText = user.nickname
    tr.append(usernameId,passwordId,nicknameId)
    table.append(tr)
  }
</script>
</body>
</html>